class Hanoi
{
  public static void main (String args[])
  {
      System.out.println("Starting test hanoi");
      int N = 3;
    H_dohanoi(N, 3, 1, 2);
  }

  static void H_dohanoi(int n, int t, int f, int u)
  {
    if (n > 0) {
      H_dohanoi(n-1, u, f, t);
      H_moveit(f, t);
      H_dohanoi(n-1, t, u, f);
    }
  }

  static void H_moveit(int from, int to)
  {
    System.out.print("move ");
    System.out.print(from);
    System.out.print(" --> ");
    System.out.println(to);
  }
}